<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">

    <title>风景宜人管理后台</title>
    <meta name="keywords" content="微信">
    <meta name="description" content="风景宜人管理后台">
    @section('css')
    {!!Html::style('/adminv/css/bootstrap.min.css')!!}
    <link href="/adminv/font-awesome/css/font-awesome.css" rel="stylesheet">

    <!-- Morris -->
    <link href="/adminv/css/plugins/morris/morris-0.4.3.min.css" rel="stylesheet">

    <!-- Gritter -->
    <link href="/adminv/js/plugins/gritter/jquery.gritter.css" rel="stylesheet">

    <link href="/adminv/css/animate.css" rel="stylesheet">
    <link href="/adminv/css/style.css" rel="stylesheet">
    <link href="/layer/skin/layer.css" rel="stylesheet">
    <link href="/layer/skin/layer.ext.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/sweetalert/sweetalert.css"/>
    @show
</head>

<body>
<div id="wrapper">
<nav class="navbar-default navbar-static-side" role="navigation">
    <div class="sidebar-collapse">
        <ul class="nav" id="side-menu">
            <li class="nav-header">

                <div class="dropdown profile-element"> <span>
                            <img alt="image" class="img-circle" src="/adminv/img/profile_small.jpg"/>
                             </span>
                    <a data-toggle="dropdown" class="dropdown-toggle" href="index.html#">
                                <span class="clear"> <span class="block m-t-xs"> <strong
                                            class="font-bold">{{\Auth::user()->name}}</strong>
                             </span> <span class="text-muted text-xs block">超级管理员 <b class="caret"></b></span> </span>
                    </a>
                    <ul class="dropdown-menu animated fadeInRight m-t-xs">
                        <li><a href="/auth/logout">安全退出</a>
                        </li>
                    </ul>
                </div>
                <div class="logo-element">
                    H+
                </div>

            </li>
            <li class="active side_menu">
                <a href="{{route('/')}}"><i class="fa fa-home"></i> <span class="nav-label">首页</span></a>
            </li>
            <li>
                <a href="#"><i class="fa fa-list-ul"></i> <span class="nav-label">菜单管理</span> <span
                        class="fa arrow"></span></a>
                <ul class="nav nav-second-level">
                    <li class="side_menu"><a href="{{route('menu.index')}}">菜单列表</a>
                    </li>
                    <li class="side_menu"><a href="{{route('newmenu')}}">添加菜单</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="#"><i class="fa fa-newspaper-o"></i> <span class="nav-label">素材管理 </span><span
                        class="fa arrow"></span></a>
                <ul class="nav nav-second-level">
                    <li class="side_menu"><a href="{{route('medialist')}}">图片库</a>
                    </li>
                    <li class="side_menu"><a href="{{route('news.index')}}">图文消息列表</a>
                    </li>
                    <li class="side_menu"><a href="{{route('news.create')}}">添加图文消息</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="#"><i class="fa fa-heartbeat"></i> <span class="nav-label">同步素材</span><span
                        class="fa arrow"></span></a>
                <ul class="nav nav-second-level">
                    <li class="side_menu"><a class="syncnews" href="javascript:void(0);">同步图文消息</a>
                    </li>
                    <li class="side_menu"><a class="syncpic" href="javascript:void(0);">同步图库</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="#"><i class="fa fa-envelope"></i> <span class="nav-label">自动消息回复管理</span><span
                        class="fa arrow"></span></a>
                <ul class="nav nav-second-level">

                    <li class="side_menu"><a href="{{route('autoreply.index')}}">自动回复列表</a>
                    </li>
                    <li class="side_menu"><a href="{{route('autoreply.create')}}">添加自动回复</a>
                    </li>

                </ul>
            </li>

        </ul>

    </div>
</nav>

<div id="page-wrapper" class="gray-bg dashbard-1">
    <div class="row border-bottom">
        <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">

            <ul class="nav navbar-top-links navbar-right">
                <li>
                <span class="m-r-sm text-muted welcome-message"><a href="/" title="返回首页"><i
                            class="fa fa-home"></i></a>欢迎使用风景宜人微信后台</span>
                </li>


                <li>
                    <a href="/auth/logout">
                        <i class="fa fa-sign-out"></i> 退出
                    </a>
                </li>
            </ul>

        </nav>
    </div>

    <div class="row">

        <div class="col-lg-12">
            <div class="wrapper wrapper-content animated fadeInRight" id="pjax_load">
                @yield('content')
            </div>

        </div>

        <div class="footer">
            <div class="pull-right">
                By：<a href="http://www.yirendai.com" target="_blank">宜人贷--风景宜人</a>
            </div>
            <div>
                <strong>Copyright</strong>  &copy; 2015
            </div>
        </div>
    </div>

</div>
</div>
@section('script')
<!-- Mainly scripts -->
<script src="/adminv/js/jquery-2.1.1.min.js"></script>
<script src="/adminv/js/bootstrap.min.js"></script>
<script src="/adminv/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/adminv/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<!---->
<!-- Custom and plugin javascript -->
<script src="/adminv/js/hplus.js@v=2.2.0"></script>
<script src="/adminv/js/plugins/pace/pace.min.js"></script>
<script type="text/javascript" src="/adminv/js/jquery.pjax.js"></script>
<script src="/js/nestable/jquery.nestable.js"></script>
<script type="text/javascript" src="/webuploader/webuploader.js"></script>
<script type="text/javascript" src="/layer/layer.js"></script>
<script type="text/javascript" src="/layer/extend/layer.ext.js"></script>

<!--medialistsegment-->
<script data-exec-on-popstate src="/js/sweetalert/sweetalert.min.js"></script>
<!--addnewssegment-->
<script src="/js/parsley/parsley.min.js?t={{time()}}"></script>
<script src="/js/parsley/parsley.extend.js?t={{time()}}"></script>
<script src="/js/jqForm/jquery.form.min.js?t={{time()}}"/>
<script src="/js/sweetalert/sweetalert.min.js?t={{time()}}"></script>
<script src="/js/parsley/zh_cn.js?t={{time()}}"></script>

<!--百度编辑器-->
<script src="/ueditor/ueditor.config.js?t={{time()}}"></script>
<script src="/ueditor/ueditor.all.js?t={{time()}}"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/lang/zh-cn/zh-cn.js?t={{time()}}"></script>

<script src="/js/win.js"></script>
<!--<script src="/js/onlineCustom.js"></script>-->
<!--<script src="/js/editor.build.min.js"></script>-->
<script src="/farbtastic/farbtastic.js"></script>
<script src="/adminv/js/plugins/jquery-ui/jquery-ui.min.js"></script>
<!--<script type="text/javascript" src="/js/juicer.js"></script>-->

<!--首页幻灯片-->
<script type="text/javascript" src="/hdp/js/modernizr.custom.js"></script>
<script type="text/javascript" src="/hdp/js/fsbs.min.js"></script>
<script>
$(function() {

    // 左侧菜单固定
    $("body").addClass('fixed-sidebar');
    $('.sidebar-collapse').slimScroll({
        height: '100%',
        railOpacity: 0.9
    });

    // 黄色主题
    $("body").removeClass("skin-1");
    $("body").removeClass("skin-2");
    $("body").addClass("skin-3");


    // pjax
//    if ($.support.pjax) {

        // 导航菜单
        $(document).pjax('.side_menu a', '#pjax_load', {"replace": false, "push": true});
        $(document).on('pjax:popstate', function () {
            console.log('pjax 后退 popstate 执行完毕！');
        });
        $(document).on('pjax:end', function (event) {
            console.log('pjax 执行完毕！');
//            $(event.target).find("script[data-exec-on-popstate]").each(function() {
//                console.log('find script to reload!');
//                $.globalEval(this.text || this.textContent || this.innerHTML || '');
//            })
        });
        // 新建菜单
        $(document).pjax('.newmenu', '#pjax_load', {"replace": false, "push": true});

        // 菜单刷新
        $(document).pjax('.fresh-loading', '#pjax_load', {"replace": false, "push": true});

        // 菜单编辑
        $(document).pjax('.menu-edit', '#pjax_load', {"replace": false, "push": true});

        // 自动回复编辑
        $(document).pjax('.reply-edit', '#pjax_load', {"replace": false, "push": true});

        // 分页
        $(document).pjax('.pagination a', '#pjax_load', {"replace": false, "push": true});
//    }

    // 同步图文
    $('.syncnews').on('click', function() {
        swal({
                title: "确定要同步？",
                text: "你确定要同步图文消息吗？",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "确定!",
                cancelButtonText: "取消",
                closeOnConfirm: false,
                showLoaderOnConfirm: true
            },
            function(){
                $.ajax({
                    url : "{{route('syncnews')}}",
                    type: 'GET',
                    success: function(data) {
                        if(data.code==2000) {
                            swal("同步成功!", data.message, "success");
                        }else {
                            swal("失败!", data.message, "error");
                        }
                    }
                });

            }
        );
    });

    // 同步图库
    $('.syncpic').on('click', function() {
        swal({
                title: "确定要同步？",
                text: "你确定要同步图库吗？",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "确定!",
                cancelButtonText: "取消",
                closeOnConfirm: false,
                showLoaderOnConfirm: true
            },
            function(){
                $.ajax({
                    url : "{{route('syncpic')}}",
                    type: 'GET',
                    success: function(data) {
                        if(data.code==2000) {
                            swal("同步成功!", data.message, "success");
                        }else {
                            swal("失败!", data.message, "error");
                        }
                    }
                });

            }
        );
    });
})
</script>
@show
<style>
    .fixed-nav .slimScrollDiv #side-menu {
        padding-bottom: 60px;
    }
</style>
</body>

</html>
